﻿@model IEnumerable<MvcAlumnos.Models.Materia>

@{
    ViewBag.Title = "Materias";
}
<p>
    <a class="btn btn-primary" href="@Url.Action("Create", "Materia")">Nueva Materia</a>
</p>
<table class="table table-striped table-hover">
    <thead>
        <tr>
            <th>Nombre</th>
            <th>Acciones</th>
        </tr>
    </thead>
    <tbody>
        @if (!Model.Any())
        {
            <tr>
                <td><b>No hay Materias aún</b>
                </td>
            </tr>
        }
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @item.Nombre

                </td>
                <td>
                @Html.ActionLink("Editar", "Edit" , new { id = item.Id }, new { @class = "btn btn-default" })
                @Html.ActionLink("Eliminar", "Delete", new { id = item.Id }, new { @class = "btn btn-danger" })
            </td>
            </tr>
        }
    </tbody>
</table>
